home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pasclern.zip / SMALLREC.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-01  |  765b  |  32 lines

  1. PROGRAM a_small_record;
  2.  
  3. TYPE description = RECORD
  4.        year    : INTEGER;
  5.        model   : STRING[20];
  6.        engine  : STRING[8];
  7.        END;
  8.  
  9. VAR  cars  : ARRAY[1..10] OF description;
  10.      index : INTEGER;
  11.  
  12. BEGIN  (* main program *)
  13.   FOR index := 1 TO 10 DO
  14.   BEGIN
  15.     cars[index].year := 1930 + index;
  16.     cars[index].model := 'Duesenburg';
  17.     cars[index].engine := 'V8';
  18.   END;
  19.  
  20.   cars[2].model := 'Stanley Steamer';
  21.   cars[2].engine := 'Coal';
  22.   cars[7].engine := 'V12';
  23.   cars[9].model := 'Ford';
  24.   cars[9].engine := 'rusted';
  25.  
  26.   FOR index := 1 TO 10 DO
  27.   BEGIN
  28.     WRITE('My ',cars[index].year:4,' ');
  29.     WRITE(cars[index].model,' has a ');
  30.     WRITELN(cars[index].engine,' engine.');
  31.   END;
  32. END.  (* of main program *)